package com.gooluke.policy;

import com.gooluke.MyRejectHandler;
import com.gooluke.MyThreadPool;

/**
 * @author gooluke
 * description 丢弃最老的请求
 * datetime 2025-04-07 22:37
 */
public class MyDiscardOldestPolicy implements MyRejectHandler {
    @Override
    public void reject(Runnable command, MyThreadPool threadPool) {
        threadPool.getBlockingQueue().poll();
        threadPool.execute(command);
    }
}
